function apptree(id,top,left){
	var html="<div id=\"treediv\" style=\"top:"+ top+"; left:"+ left +"\" class=\"treecategory\">"
	html=html + "<ul id=\"tree\" class=\"filetree\">";
	var test = window.location.pathname;
	var sts=test.split("/"); 
	var turl="/" + sts[1] +"/set/category/getall";
	 $.ajax({
           type: "GET",
           url: turl,
           contentType: "application/x-www-form-urlencoded;charset=UTF-8",
           async: true, // 同步  true 异步。默认是异步
           dataType: 'json',
           error: function(resultdata) {
           	//layer.closeAll();
           },
           success: function(resultdata) {
          // 	layer.closeAll();
        	   initcategory(html,resultdata);
           }
       });
} 	 
function initcategory(html,resultdata){
	for (var i = 0;i < resultdata.items;i++ ) {
		var item=resultdata.items[i];
		html =html + "<li><span class=\"folder\" >"+ item.currentCategory.categoryLevel +"、"+ item.currentCategory.categoryName+ "</span>";
		if(item.isHasChild==1){
			html =html + "<ul class=\"ul\">";
			for (var j = 0;j < item.childCategory;j++ ) {
				var cate2=item.childCategory[j];
				html =html + "<li><span class=\"folder\" >"+ cate2.currentCategory.categoryLevel +"、"+ cate2.currentCategory.categoryName+ "</span>";
				if(cate2.isHasChild==1){
					html =html + "<ul class=\"ul\">";
					for (var k = 0;k < cate2.childCategory;k++ ) {
						var cate3=cate2.childCategory[j];
						html =html + "<li><span class=\"folder\" >"+ cate3.currentCategory.categoryLevel +"、"+ cate3.currentCategory.categoryName+ "</span>";
					}
					html =html + "</ul>";
				}
				html =html + "</li>";
			}
			html =html + "</ul>";
		}
		html =html + "</li>";
	}
}